<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>添加</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script src="../../../../lib/include.js"></script>
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/zTree/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/bootstrap-fileinput/css/fileinput.min.css">
    <link rel="stylesheet" href="../../../../../../public-tools/pc/plugins/diyUpload/diyUpload.css">
    <link rel="stylesheet" href="../../../../../../public-tools/pc/css/plugins/csshover/style.css">
    <style>
        .form-control:focus,
        .single-line:focus {
            border-color: #0e9aef !important;
        }

        .checkbox-inline {
            line-height: 5px;
        }
        .file-uploadImgs {
            margin: 10px;
            border: 1px dashed gainsboro;
            border-radius: 5px;
        }
        /* 谷歌、苹果浏览器 */
        ::-webkit-scrollbar {
            display: none;
        }
        .w-e-text-container {
            height: 800px !important;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content" id="app">

    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <form id="Form" autocomplete="off">
                <div style="padding: 0">
                    <input type="hidden" name="id" value="">
                    <input type="hidden" name="version" value="0">
                    <input type="hidden" name="type" value="2">
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">套餐名字</label>
                            <input class="form-control" type="text" name="name" v-model="info.name"
                                   value="" placeholder="请输入套餐名字">
                        </div>
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">套餐原价</label>
                            <input class="form-control" type="text" name="oldPrice" min="0" v-model="info.oldPrice" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')"
                                   value="" placeholder="请输入套餐原价">
                        </div>
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">套餐售价</label>
                            <input class="form-control" type="text" name="price" min="0" v-model="info.price" oninput="value=value.replace(/[^\d(\.\d{1,2})]/g,'')"
                                   value="" placeholder="请输入套餐售价">
                        </div>
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">套餐库存</label>
                            <input class="form-control" type="number" name="inventory" v-model="info.inventory"
                                   value="" placeholder="请输入套餐库存">
                        </div>
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">套餐排序</label>
                            <input class="form-control" type="number" name="sort" v-model="info.sort"
                                   value="100" placeholder="请输入套餐排序">
                        </div>
                        <!--<div class="col-sm-4 form-group">
                            <label class="form-inline">套餐品牌</label>
                            <select class="form-control" name="brandId" v-model="info.brandId">
                                <option v-for="(item,index) in gBrandList" :value="item.id">{{item.name}}</option>
                            </select>
                        </div>-->
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">是否促销</label>
                            <div>
                                <select class="form-control" name="isHot" v-model="info.isHot">
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">是否优惠</label>
                            <div>
                                <select class="form-control" name="isNew" v-model="info.isNew">
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">是否置顶</label>
                            <div>
                                <select class="form-control" name="isTop" v-model="info.isTop">
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-4 form-group">
                            <label class="form-inline">套餐状态</label>
                            <div>
                                <select class="form-control" name="state" v-model="info.state">
                                    <option value="1">上架</option>
                                    <option value="0">下架</option>
                                </select>
                            </div>
                        </div>
                        <!--<div class="col-sm-4 form-group">
                            <label class="form-inline">套餐类型</label>
                            <input class="form-control" type="hidden" name="typeId" id="typeId" v-model="info.typeId">
                            <input class="form-control" type="text" id="typeName" v-model="info.typeName"
                                   value="" placeholder="请点击套餐类型" title="请点击套餐类型" readonly style="cursor: pointer"
                                   @click="setDept">
                        </div>-->
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12 form-group">
                            <label class="form-inline">商品品牌</label>
                            <div class="input-group m-b" style="border: 1px solid;padding: 8px;width: 100%;" id="goodsBrand">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12 form-group">
                            <label class="form-inline">商品类型</label>
                            <div class="input-group m-b" style="border: 1px solid;padding: 8px;width: 100%;" id="goodsType">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 form-group">
                        <div class="col-sm-12 form-group">
                            <label class="form-inline">套餐简介</label>
                            <textarea name="introduction" class="form-control" rows="3" v-model="info.introduction" placeholder="请输入套餐简介">
                                {{info.introduction}}
                            </textarea>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12 form-group">
                    <label class="form-inline">套餐描述</label>
                    <div>
                        <input id="articleContent" type="hidden" name="description" v-model="info.description">
                        <div id="editor">
                        </div>
                    </div>
                </div>
                <!--规格-->
                <div class="col-sm-12 form-group">
                    <label class="form-inline">配置套餐型号</label>
                    <div class="row">
                        <div class="col-sm-6 col-md-4" v-for="(item,index) in specList">
                            <div class="thumbnail" style="height: 450px">
                                <div style="text-align: center;height: 120px;">
                                    <img style="display: inline-block;max-height: 120px;;max-width: 45%" class="img-thumbnail" v-for="(item1,index1) in item.imgs" v-if="index1<2" :src="item1.url">
                                </div>
                                <div class="caption">
                                    <h3 style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item.name}}</h3>
                                    <div class="list-group" style="height: 220px;overflow: scroll;margin-top: 10px">
                                        <button type="button" class="list-group-item" v-for="item2 in item.params">{{item2.paramName}}：{{item2.paramInfo}}</button>
                                    </div>
                                    <p style="float: right">
                                        <a href="javascript:void(0);" @click="addOrUpdateSpec(item.id)" class="btn btn-primary" role="button">修改</a>
                                        <a href="javascript:void(0);" @click="deleteSpec(item.id)" class="btn btn-default" role="button">删除</a>
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6 col-md-4">
                            <div class="thumbnail" @click="addOrUpdateSpec()" style="height: 450px;border: 3px dashed gainsboro;border-radius: 5px;text-align: center;cursor: pointer">
                                <span style="font-size: 100px;margin-top: 125px;display: block">+</span>
                            </div>
                        </div>
                    </div>
                </div>
                <!--商品关联-->
                <div class="col-sm-12 form-group">
                    <label class="form-inline">配置关联商品</label>
                    <div class="file-uploadImgs">
                        <div style="padding: 20px;">
                            <div class="Service-box">
                                <div class="Service-content clearfix">
                                    <a href="javascript:void(0);" class="Service-item" v-for="(item,index) in goodsList">
                                        <div class="item-image">
                                            <img :src="item.showUrl" alt="">
                                        </div>
                                        <h3 class="item-title">{{item.name}}</h3>
                                        <div class="item-text">{{item.introduction}}</div>
                                        <span class="item-link" @click="delGoods(index)">删除商品</span>
                                    </a>
                                    <div class="Service-item" @click="addGoods()" style="border: 3px dashed gainsboro;border-radius: 10px;text-align: center;cursor: pointer">
                                        <span style="font-size: 100px;display: block">+</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group" style="margin-top: 10px" id="file">
                    <label class="form-inline">封面图片（仅传一张）<font style="color: red">尺寸：【】</font></label>
                    <input id="articleImg" type="hidden" name="imgId" v-model="info.imgId">
                    <input type="hidden" id="oldImgId" name="oldImgId" v-model="info.oldImgId">
                    <div class="file-loading">
                        <input id="fileUploadBtn" type="file" name="file">
                    </div>
                </div>
                <div class="form-group" style="margin-top: 10px" id="files">
                    <label class="form-inline">详情图片（可传多张,红色边框为视频）<font style="color: red">尺寸：【】</font></label>
                    <div class="file-uploadImgs">
                        <div style="padding: 20px;">
                            <ul class="upload-ul clearfix">
                                <li class="upload-pick">
                                    <div class="webuploader-container clearfix" id="uploadImgs">
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>

                <div style="text-align: center">
                    <a href="javascript:parent.layer.closeAll();" class="btn btn-default" style="width: 10%;">关 闭</a>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-if="permission(0)">保存</button>
                    <button type="submit" class="btn btn-primary" style="width: 10%;" v-else="permission(1)">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="../../../../../../public-tools/pc/plugins/zTree/jquery.ztree.core.min.js"></script>
<script type="text/javascript" src="../../../../../../public-tools/pc/plugins/zTree/jquery.ztree.excheck.min.js"></script>
<script src="../../../../../../public-tools/pc/plugins/wangEditor/wangEditor-video.js"></script>
<script src="../../../../../../public-tools/pc/plugins/bootstrap-fileinput/js/fileinput.min.js"></script>
<script src="../../../../../../public-tools/pc/plugins/diyUpload/webuploader.min.js"></script>
<script src="../../../../../../public-tools/pc/plugins/diyUpload/diyUpload.js"></script>
<script src="../../../../js/content-manage/goods/package/edit.js"></script>
</body>
</html>
